import pymysql

con = pymysql.connect(host="localhost",user="root",password="123456",port=3306,database="mysql")
cursor = con.cursor()
cursor.execute("show databases")
res = cursor.fetchall()
print(res)